home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MT-RechnungIII
/
Rexx
/
FWRegistrierung.brarexx
< prev
next >
Wrap
Text File
|
1998-11-16
|
6KB
|
285 lines
/*
** Druck-, Vorschau, Sichern eines Registrierungsformulars mit Hilfe von FinalWriter
** $VER: FWRegistrerung.brarexx V1.00 (16.11.98)
*/
PARSE ARG ARexxPort;
ADDRESS VALUE ARexxPort;
OPTIONS RESULTS;
FWVorlage = "FWDokumente/Registrierung.fw";
FWDokument = "t:Registrierung.fw";
FWPort = "FINALW."
LF = '0a'x; /* Zeilenvorschub */
Gefunden = 0;
DO i = 1 TO 20 WHILE(Gefunden = 0)
IF show(ports, (FWPort || i)) THEN
DO;
Gefunden = 1;
FWPort = FWPort || i;
END;
END;
IF Gefunden = 0 THEN
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "FinalWriter ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
ES_GADGETFORMAT = "Abbrechen";
EASY_REQUEST;
EXIT;
END;
/* Original FW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
/* dieser Vorlage zu verhindern */
GET_REXXPATH;
FWVorlage = MTR_RESULT || FWVorlage;
ADDRESS COMMAND "copy" FWVorlage FWDokument;
/* Oberfläche sperren */
LOCKGUI;
/* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
PRINTSTATE;
Druckart = MTR_RESULT;
Ende_Kennzeichen = 'N';
/* Suchen der zu druckenden Daten */
PRINTFIND;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
ADDRESS VALUE FWPort;
SCREENTOFRONT;
CALL DatenAufbereiten;
SELECT;
WHEN Druckart = 0 THEN /* Drucken */
DO;
ADDRESS VALUE FWPort;
PRINT;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
WHEN Druckart = 1 THEN /* Vorschau */
ADDRESS VALUE ARexxPort;
WHEN Druckart = 2 THEN /* Sichern */
DO;
ADDRESS VALUE FWPort;
SAVEAS;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
OTHERWISE
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "Druckart wird nicht unterstützt!";
ES_GADGETFORMAT = "Ok";
EASY_REQUEST;
Ende_Kennzeichen = 'J';
END;
END;
PRINTFIND;
END;
/* WordWorth-Datei aus t: wieder entfernen */
ADDRESS COMMAND "delete" FWDokument;
/* Oberfläche wieder entsperren */
ADDRESS VALUE ARexxPort;
FREEGUI;
EXIT;
DatenAufbereiten:
ADDRESS VALUE ARexxPort;
FORMAT_DATE_LONG date(s);
PRINTDATE = MTR_RESULT;
NAME_OF_SALUTATION OFFICE.ADDRESS.SALUTATION;
ZW_Anrede = MTR_RESULT;
IF OFFICE.ADDRESS.BANK_CODE_NUMBER = "0" THEN
OFFICE.ADDRESS.BANK_CODE_NUMBER = " ";
GET_COUNTRY OFFICE.ADDRESS.COUNTRY_NUMBER;
FORMAT_DATE_LONG OFFICE.ADDRESS.BIRTHDAY;
ZW_BIRTHDAY = MTR_RESULT;
ADDRESS VALUE FWPort;
CLEARDOC;
OPEN FWDokument;
DruckString = OFFICE.ADDRESS.ADDRESS.2 || LF;
i = INDEX( DruckString, LF);
IF i > 0 THEN
DO;
DruckTeil = LEFT( DruckString, (i - 1) );
DruckString = SUBSTR(DruckString, (i + 1) );
i = INDEX( DruckString, LF);
END;
ELSE
DruckTeil = DruckString;
FIND "<OFFICE.ADDRESS.2>";
FINDNEXT;
STATUS LinePos;
PARSE VAR RESULT BegLine BegPosition EndLine EndPosition;
TYPE DruckTeil;
FIND "<PRINTDATE>"
TYPE PRINTDATE;
DO WHILE( i > 0 );
DruckTeil = LEFT( DruckString, (i - 1) );
DruckString = SUBSTR(DruckString, (i + 1) );
BegLine = BegLine + 1;
MoveToLine BegLine 0;
TYPE DruckTeil;
i = INDEX( DruckString, LF);
END;
FIND "<OFFICE.ADDRESS.ADDRESS.0>";
TYPE OFFICE.ADDRESS.ADDRESS.0;
FIND "<OFFICE.ADDRESS.SALUTATION>";
TYPE ZW_Anrede;
FIND "<OFFICE.ADDRESS.SURNAME>";
IF OFFICE.ADDRESS.SURNAME = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.SURNAME;
FIND "<OFFICE.ADDRESS.PRENAME>";
IF OFFICE.ADDRESS.PRENAME = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.PRENAME;
FIND "<OFFICE.ADDRESS.COMPANY1>";
IF OFFICE.ADDRESS.COMPANY1 = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.COMPANY1;
FIND "<OFFICE.ADDRESS.COMPANY2>";
IF OFFICE.ADDRESS.COMPANY2 = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.COMPANY2;
FIND "<OFFICE.ADDRESS.STREET>";
IF OFFICE.ADDRESS.STREET = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.STREET;
FIND "<OFFICE.ADDRESS.ZIP>";
IF OFFICE.ADDRESS.ZIP = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.ZIP;
FIND "<OFFICE.ADDRESS.CITY>";
IF OFFICE.ADDRESS.CITY = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.CITY;
FIND "<COUNTRY.NAME>";
IF COUNTRY.NAME = "" THEN
TYPE " ";
ELSE
TYPE COUNTRY.NAME;
i = OFFICE.ADDRESS.STATE_NUMBER;
FIND "<COUNTRY.STATE>";
IF COUNTRY.STATE.i = "" THEN
TYPE " ";
ELSE
TYPE COUNTRY.STATE.i;
FIND "<OFFICE.ADDRESS.PHONE>";
IF OFFICE.ADDRESS.PHONE = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.PHONE;
FIND "<OFFICE.ADDRESS.FAX>";
IF OFFICE.ADDRESS.FAX = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.FAX;
FIND "<OFFICE.ADDRESS.EDI>";
IF OFFICE.ADDRESS.EDI = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.EDI;
FIND "<OFFICE.ADDRESS.EMAIL.0>";
IF OFFICE.ADDRESS.EMAIL.0 = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.EMAIL.0;
FIND "<OFFICE.ADDRESS.EMAIL.1>";
IF OFFICE.ADDRESS.EMAIL.1 = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.EMAIL.1;
FIND "<OFFICE.ADDRESS.EMAIL.2>";
IF OFFICE.ADDRESS.EMAIL.2 = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.EMAIL.2;
FIND "<OFFICE.ADDRESS.BANK_CODE_NUMBER>";
IF OFFICE.ADDRESS.BANK_CODE_NUMBER = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.BANK_CODE_NUMBER;
FIND "<OFFICE.ADDRESS.BANK_NAME>";
IF OFFICE.ADDRESS.BANK_NAME = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.BANK_NAME;
FIND "<OFFICE.ADDRESS.BANK_SHORT>";
IF OFFICE.ADDRESS.BANK_SHORT = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.BANK_SHORT;
FIND "<OFFICE.ADDRESS.ACCOUNT>";
IF OFFICE.ADDRESS.ACCOUNT = "" THEN
TYPE " ";
ELSE
TYPE OFFICE.ADDRESS.ACCOUNT;
FIND "<OFFICE.ADDRESS.BIRTHDAY>";
IF ZW_BIRTHDAY = "" THEN
TYPE " ";
ELSE
TYPE ZW_BIRTHDAY;
IF OFFICE.ADDRESS.SURNAME = "" THEN
ZW_SUR_PRENAME = "Unterschrift";
ELSE
ZW_SUR_PRENAME = OFFICE.ADDRESS.PRENAME OFFICE.ADDRESS.SURNAME;
FIND "<OFFICE.SUR_PRENAME>";
TYPE ZW_SUR_PRENAME;
RETURN;